package com.raysdata.smartcity.web.common;

import java.io.FileInputStream;
import java.util.Properties;

/**
 * Created by bh on 2016/11/11.
 */
public class Property {

    private String config=this.getClass().getResource("/").getPath()+"/config.properties";

    public String getProperty(String key)throws Exception{
        Properties pro = new Properties();
        pro.load(new FileInputStream(config));
        String value = pro.getProperty(key);
        return value;
    }
    public static String getValue(String key){
        String value="";
        Property property=new Property();
        try {
            value=property.getProperty(key);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return value;
    }
}
